package priv.books.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import lombok.Data;

/**
    * 订单详情表
    */
@Data
@TableName(value = "order_detail")
public class OrderDetail {
    /**
     * 自增主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 对应的订单ID
     */
    @TableField(value = "order_id")
    private Integer orderId;

    /**
     * 对应的书籍信息
     */
    @TableField(value = "books_name")
    private String booksName;

    /**
     * 购买数量
     */
    @TableField(value = "pay_num")
    private Integer payNum;

    /**
     * 书籍单价
     */
    @TableField(value = "unit_price")
    private BigDecimal unitPrice;

    /**
     * 价格小计
     */
    @TableField(value = "total_price")
    private BigDecimal totalPrice;

    /**
     * 书籍ID
     */
    @TableField(exist = false)
    private Integer booksId;

    /**
     * 订单详情关联的图书信息
     */
    @TableField(exist = false)
    private Books books;

    public static final String COL_ID = "id";

    public static final String COL_ORDER_ID = "order_id";

    public static final String COL_BOOKS_NAME = "books_name";

    public static final String COL_PAY_NUM = "pay_num";

    public static final String COL_UNIT_PRICE = "unit_price";

    public static final String COL_TOTAL_PRICE = "total_price";
}